<div class="row search-box">
    <div class="large-12 columns centered">
        <div id="loader">
            <div class="border">
                <h5 class="title">Resultados de búsqueda</h5>
                <div class="carousel">
                    <div class="large12 columns text-center">
                        <img src="<?php echo base_url(); ?>images/loading.gif" /><br/>Cargando...
                    </div>
                </div>
            </div>
        </div>
        <div id="results"></div>
    </div>
</div>

<div class="row">
    <div class="large-12 columns">
        <div class="border">
            <h5 class="title">Datos del vehiculo</h5>
            <div class="carousel">
                <?php foreach ($modelo as $data): ?>
                    <div class="large-12 columns">
                        <table class="responsive" width="100%">
                            <tr>
                                <th class="text-left large-10">
                            <ul class="button-group radius">
                                <li><a href="#" data-reveal-id="citas" class="button secondary small">Solicitar Cita</a></li>
                                <li><a href="#" data-reveal-id="consultas" class="button secondary small">Realizar Consulta</a></li>
                                <li><a href="<?php echo base_url() ?>paypal/index.php?id=<?php echo $this->id; ?>&carro=<?php echo $data->marca . ' - ' . $data->modelo; ?>" class="button secondary small" target="_blank">Paguelo Aqui</a></li>
                            </ul>
                            <span class='st_facebook' displayText='Facebook'></span>
                            <span class='st_twitter' displayText='Tweet'></span>
                            <span class='st_linkedin' displayText='LinkedIn'></span>
                            </th>
                            <th class="text-left large-2 text-center">Extras</th>
                            </tr>
                            <tr>
                                <td class="vehicle-data" valign="top">
                                    <span class="title">Marca:</span> <span class="data"><?php echo $data->marca ?></span>
                                    <span class="title">Modelo:</span> <span class="data"><?php echo $data->modelo; ?></span><br/>  

                                    <span class="title">Tipo:</span> <span class="data"><?php echo $data->tipo; ?></span>
                                    <span class="title">Año:</span> <span class="data"><?php echo $data->anno; ?></span><br/>

                                    <span class="title">Cinlindrada:</span> <span class="data"><?php echo $data->cilindrada; ?></span>
                                    <span class="title">Color:</span> <span class="data"><?php echo $data->color_exterior; ?></span><br/>

                                    <span class="title">Color interior:</span> <span class="data"><?php echo $data->color_interior; ?></span>
                                    <span class="title">Combustible:</span> <span class="data"><?php echo $data->combustible; ?></span><br/>

                                    <span class="title">Kilometraje:</span> <span class="data"><?php echo $data->kilometraje; ?> kms.</span>
                                    <span class="title">Transmision:</span> <span class="data"><?php echo $data->transmision; ?></span><br/>

                                    <span class="title">Precio:</span> <span class="data"><?php echo $data->precio; ?></span>
                                    <span class="title">Puertas:</span> <span class="data"><?php echo $data->puertas; ?></span><br/>

                                    <ul class="clearing-thumbs" data-clearing>
                                        <?php if ($data->foto1 != NULL): ?><li><a class="th" href="<?php echo base_url() . 'assets/uploads/files/' . $data->foto1; ?>"><img data-caption="caption here" src="<?php echo base_url() . 'assets/uploads/files/' . $data->foto1; ?>"></a></li><?php endif; ?>
                                        <?php if ($data->foto2 != NULL): ?><li><a class="th" href="<?php echo base_url() . 'assets/uploads/files/' . $data->foto2; ?>"><img data-caption="caption here" src="<?php echo base_url() . 'assets/uploads/files/' . $data->foto2; ?>"></a></li><?php endif; ?>
                                        <?php if ($data->foto3 != NULL): ?><li><a class="th" href="<?php echo base_url() . 'assets/uploads/files/' . $data->foto3; ?>"><img data-caption="caption here" src="<?php echo base_url() . 'assets/uploads/files/' . $data->foto3; ?>"></a></li><?php endif; ?>
                                        <?php if ($data->foto4 != NULL): ?><li><a class="th" href="<?php echo base_url() . 'assets/uploads/files/' . $data->foto4; ?>"><img data-caption="caption here" src="<?php echo base_url() . 'assets/uploads/files/' . $data->foto4; ?>"></a></li><?php endif; ?>
                                        <?php if ($data->foto5 != NULL): ?><li><a class="th" href="<?php echo base_url() . 'assets/uploads/files/' . $data->foto5; ?>"><img data-caption="caption here" src="<?php echo base_url() . 'assets/uploads/files/' . $data->foto5; ?>"></a></li><?php endif; ?>
                                        <?php if ($data->foto6 != NULL): ?><li><a class="th" href="<?php echo base_url() . 'assets/uploads/files/' . $data->foto6; ?>"><img data-caption="caption here" src="<?php echo base_url() . 'assets/uploads/files/' . $data->foto6; ?>"></a></li><?php endif; ?>
                                        <?php if ($data->foto7 != NULL): ?><li><a class="th" href="<?php echo base_url() . 'assets/uploads/files/' . $data->foto7; ?>"><img data-caption="caption here" src="<?php echo base_url() . 'assets/uploads/files/' . $data->foto7; ?>"></a></li><?php endif; ?>
                                        <?php if ($data->foto8 != NULL): ?><li><a class="th" href="<?php echo base_url() . 'assets/uploads/files/' . $data->foto8; ?>"><img data-caption="caption here" src="<?php echo base_url() . 'assets/uploads/files/' . $data->foto8; ?>"></a></li><?php endif; ?>
                                        <?php if ($data->foto9 != NULL): ?><li><a class="th" href="<?php echo base_url() . 'assets/uploads/files/' . $data->foto9; ?>"><img data-caption="caption here" src="<?php echo base_url() . 'assets/uploads/files/' . $data->foto9; ?>"></a></li><?php endif; ?>
                                        <?php if ($data->foto10 != NULL): ?><li><a class="th" href="<?php echo base_url() . 'assets/uploads/files/' . $data->foto10; ?>"><img data-caption="caption here" src="<?php echo base_url() . 'assets/uploads/files/' . $data->foto10; ?>"></a></li><?php endif; ?>
                                    </ul>

                                </td>
                                <td class="vehicle-data" valign="top">
                                    <ul class="extras">
                                        <?php if (!empty($extras)): ?>
                                            <?php foreach ($extras as $extra): ?>            
                                                <li class="title"><?php echo $extra->extra; ?></li>
                                            <?php endforeach; ?>
                                        <?php else: ?>
                                            <li class="title">***** Ninguno *****</li>
                                        <?php endif; ?>
                                    </ul>
                                </td>
                            </tr>
                        </table>
                    </div>
                <?php endforeach; ?>
            </div>
        </div>
    </div>
</div>

<div id="citas" class="reveal-modal row">
    <form id="cita" name="form" class="custom">
        <input name="url" type="hidden" value="<?php echo 'http://' . $_SERVER["HTTP_HOST"] . $_SERVER['REQUEST_URI']; ?>"/>
        <fieldset>
            <legend>Formulario de citas: <?php echo $data->marca . ' ' . $data->modelo; ?></legend>

            <div class="large-12 columns">
                <div class="date" id="dpYears" data-date="01-04-2013" data-date-format="dd-mm-yyyy" data-date-viewmode="years">
                    <input class="columns large-3" id="cita-date" size="16" type="text" value="01-04-2013" readonly="">
                    <span class="prefix columns large-1 end">
                        <i class="icon-calendar"></i>
                    </span>
                </div>

                <input name="nombre" type="text" placeholder="Nombre">
                <input name="telefono" type="text" placeholder="Telefono">
                <input name="email" type="text" placeholder="Email">
                <input type="submit" class="small button secondary" value="Solicitar Cita">
            </div>

        </fieldset>
    </form>

    <div id="citas-results" class="large-12 columns"></div>

    <a class="close-reveal-modal">×</a>
</div>
<div id="consultas" class="reveal-modal row">
    <form id="consulta" name="form" class="custom">
        <input name="url" type="hidden" value="<?php echo 'http://' . $_SERVER["HTTP_HOST"] . $_SERVER['REQUEST_URI']; ?>"/>
        <fieldset>
            <legend>Formulario de consultas: <?php echo $data->marca . ' ' . $data->modelo; ?></legend>

            <div class="large-12 columns">
                <input name="nombre" type="text" placeholder="Nombre">
                <input name="email" type="text" placeholder="Email">
                <textarea name="consulta" placeholder="Consulta"></textarea>
                <input type="submit" class="small button secondary" value="Enviar Consulta">
            </div>

        </fieldset>
    </form>

    <div id="consultas-results" class="large-12 columns"></div>

    <a class="close-reveal-modal">×</a>
</div>
<script>
    var d = new Date();
    var day = d.getDay();
    var month = d.getMonth() + 1;
    var year = d.getFullYear();

    var today = '0';
    if (day < 10) {
        today = '0' + day;
    } else {
        today = day;
    }
    var month2 = '0';
    if (month < 10) {
        month2 = '0' + month;
    } else {
        month2 = month;
    }

    $('#cita-date').val(today + "-" + month2 + "-" + year);
</script>


<div class="row container">
    <div class="large-12 columns">
        <!--COMPARE -->        
        <div class="border">
            <h5 class="title">Compare</h5>
            <div id="compare-results"></div>
            <div class="carousel">
                <div style="background-color:#FFFFCC; color:#000; padding:5px;">
                    Para comparar 2 o mas vehiculos, marque el cuadro
                    <input type="checkbox" name="demo" value="checkbox" checked="">
                    arriba de cada vehiculo que desea incluir en la comparacion y oprima el boton de <b>comparar</b> que será
                    habilitado una vez que seleccione como mínimo 2 vehículos.
                    El vehículo que está activo será enmarcado con rojo.</div>
                <form name="form" method="post" action="compare" id="carCompare">
                    <div id="submitBtn">
                        <input name="carCompareSubmit" type="submit" id="carCompareSubmit" value="Comparar" disabled="disabled">
                        <input type="reset" name="Reset" id="resetButton" value="Limpiar Selección" onclick="this.form.reset()">
                    </div>
                    <div id="idCarCompareValues"></div>
                    <?php foreach ($compare as $data): ?>
                        <?php //if ($data->id != $this->id): ?>
                        <div class="large-2 mobile-two columns">
                            <input class="checkCompare" type="checkbox" name="compare<?php echo $data->id; ?>" value="<?php echo $data->id; ?>">
                            <a class="th radius" href="modelo/<?php echo $data->id; ?>">
                                <img src="<?php echo base_url() . 'assets/uploads/files/' . $data->foto1; ?>"/>
                                <div class="panel">
                                    <h5><?php echo $data->marca . ' ' . $data->modelo; ?></h5>
                                    <h6 class="year"><span>A&ntilde;o:</span> <?php echo $data->anno; ?></h6>
                                    <h6 class="price"><span>Precio:</span> <?php echo $data->precio; ?></h6>
                                </div>
                            </a>
                        </div>
                        <?php //endif; ?>
                    <?php endforeach; ?>
                </form>
            </div>
        </div>
        <!--COMPARE -->
    </div>
</div>